﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AuditTable_Edit.aspx.cs" Inherits="Honestysoft.Financing.WebUI.Module.Audit.AuditTable_Edit" %>
<%@ Register src="../../Workflow/Apply/WFButtons.ascx" tagname="WFButtons" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <link rel="stylesheet" type="text/css" href="../../Styles/control.css" />
    <link rel="stylesheet" type="text/css" href="../../Styles/easyui.css" />
	<link rel="stylesheet" type="text/css" href="../../Styles/icon.css" />
    <script language="javascript" type="text/javascript" src="../../Scripts/jquery-1.4.1.js"></script>
    <script language="javascript" type="text/javascript" src="../../Scripts/control.js"></script>    
	<%--<script type="text/javascript" src="../../Scripts/jquery-1.6.min.js"></script>--%>
	<script type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
    <script type="text/javascript">
//        function nmKeyDown() {
//            var k = window.event.keyCode; //判断K是否是合法的ASCII码
//            return isValidNum(k);
//        }
//        function isValidNum(k) {
//            return ((k == 9) || (k == 188) || (k == 13) || (k == 46) || (k == 8) || (k == 189) || (k == 109) || (k == 190) || (k == 110) || (k >= 48 && k <= 57) || (k >= 96 && k <= 105) || (k >= 37 && k <= 40));
//        }
        function commafy(num) {
            num = num + "";
            var re = /(-?\d+)(\d{3})/
            while (re.test(num)) {
                num = num.replace(re, "$1,$2")
            }
            return num;
        }
//        function numPaste() {
//            clipboardData.setData('text', clipboardData.getData('text').replace(/[,]/g, ''));
////            var text = clipboardData.getData('Text'); //取得粘贴板中的值
////            for (var i = 0; i < text.length; i++) {
////                var asc = text.charCodeAt(i); //charAt--"3",charCodeAt()取得的是ASCTT码
////                if (!isValidNum(asc)) { //遇到非法值就认为要粘贴的内容是非法的return false
////                    return false;
////                }
////            }
//        }
    </script>
	<script language="javascript" type="text/javascript">
		//展开收起操作
		function change(objID) {
		    if (document.all("tb_" + objID).style.display == "block") {
		        document.all("img_" + objID).src = "../../images/ico_have2.gif";
		        document.all("img_" + objID).alt = "展开";
		        document.all("tb_" + objID).style.display = "none"
		    }
		    else {
		        document.all("img_" + objID).src = "../../images/ico_nohave2.gif";
		        document.all("img_" + objID).alt = "收起";
		        document.all("tb_" + objID).style.display = "block"
		    }
		}
        function expandAll() {
		    for (var i = 1; i <= 10; i++) {
		        document.all("img_" + i).src = "../../images/ico_nohave2.gif";
		        document.all("img_" + i).alt = "收起";
		        document.all("tb_" + i).style.display = "block";
		    }
		}
		function collapseAll() {
		    for (var i = 1; i <= 10; i++) {
		        document.all("img_" + i).src = "../../images/ico_have2.gif";
		        document.all("img_" + i).alt = "展开";
		        document.all("tb_" + i).style.display = "none"
		    }
		}

        //签收
		function doReceive(id) {
            var bl = parseFloat(<%=theTable.SummaryAmount.TAmount_P %>/<%=theTable.Amount_ZBJ%>).toFixed(2);
            if(bl >= 2.34){
                if(!confirm("融资资金/资本金="+bl+"≥2.34，你是否确定仍然要继续签收？")){
                    return false;
                }
            }
		    var retValue=  window.showModalDialog("AuditTableReceive.aspx?ID=" + id, window, 'dialogHeight=500px;dialogWidth=560px;help=no;scrollbars=no;status=no');
		    if (typeof (retValue) != "undefined" && retValue != null && retValue) {
                outputExcel();
                window.opener.location.reload();
		        return true;
		    }
		    return false;
		}

        //校验输入的申请金额
        function confirmDocRec(amount,flag){
            var inputAmount = document.getElementById("<%=numAmount_DocRec.ClientID %>").value;
            if(inputAmount==""){inputAmount="0";document.getElementById("<%=numAmount_DocRec.ClientID %>").value="0";}
            if(parseFloat(inputAmount) == 0){
                alert('审核过程中本合同本笔申请资金金额不能为0！');
                document.getElementById("<%=numCurAmount.ClientID %>").value =amount;
                return;
            }
		    if (parseFloat(amount) != parseFloat(inputAmount)) {
		        if (flag == "0") {//与回执比较
		            if (!confirm("输入的本合同本笔申请资金金额(" + inputAmount + ")与回执中记录的金额(" + amount + ")不同，您确定使用您输入的金额为准吗？")) {
		                document.getElementById("<%=numAmount_DocRec.ClientID %>").value = "";
		                document.getElementById("<%=numAmount_DocRec.ClientID %>").focus();
		            }
		        }
		        else if (flag == "1") {//与审核员比较
		            if (!confirm("输入的本合同本笔申请资金金额(" + inputAmount + ")与审核员输入的金额(" + amount + ")不同，您确定使用您输入的金额为准吗？")) {
		                document.getElementById("<%=numAmount_DocRec.ClientID %>").value = "";
		                document.getElementById("<%=numAmount_DocRec.ClientID %>").focus();
		            }
		        }
		    }
        }
        //校验合同金额
		function confirmContract(amount, flag) {
		    var inputAmount = document.getElementById("<%=numAmount_C.ClientID %>").value;
		    if (parseFloat(amount) != parseFloat(inputAmount)) {
		        if (flag == "0") {
		            if (!confirm("输入的合同总价金额(" + inputAmount + ")与系统中记录的合同总价金额(" + amount + ")不同，您确定使用您输入的金额为准吗？")) {
		                document.getElementById("<%=numAmount_C.ClientID %>").value = "";
		                document.getElementById("<%=numAmount_C.ClientID %>").focus();
		            }
		        }
		        else if (flag == "1") {
		            if (!confirm("输入的合同总价金额(" + inputAmount + ")与审核员输入的合同总价金额(" + amount + ")不同，您确定使用您输入的金额为准吗？")) {
		                document.getElementById("<%=numAmount_C.ClientID %>").value = "";
		                document.getElementById("<%=numAmount_C.ClientID %>").focus();
		            }
		        }
		    }
		}
        //校验最终审核金额
		function confirmAmount(amount, flag) {
		    var inputAmount = document.getElementById("<%=numCurAmount.ClientID %>").value;
            if(parseFloat(inputAmount) == 0){
                alert('审核过程中本合同本笔申请资金的审核金额不能为0！');
                document.getElementById("<%=numCurAmount.ClientID %>").value =amount;
                return;
            }
		    if (parseFloat(amount) != parseFloat(inputAmount)) {
		        if (flag == "0") {
		            if (!confirm("输入的本合同本笔申请资金金额(" + inputAmount + ")与回执中申请金额(" + amount + ")不同，您确定使用您输入的金额为准吗？")) {
		                document.getElementById("<%=numCurAmount.ClientID %>").value = "";
		                document.getElementById("<%=numCurAmount.ClientID %>").focus();
		            }
		        }
		        else if (flag == "1") {
		            if (!confirm("输入的本合同本笔申请资金金额(" + inputAmount + ")与审核员输入的金额(" + amount + ")不同，您确定使用您输入的金额为准吗？")) {
		                document.getElementById("<%=numCurAmount.ClientID %>").value = "";
		                document.getElementById("<%=numCurAmount.ClientID %>").focus();
		            }
		        }
		    }
		}
        //校验累计拨付金额
		function confirmTotalBFAmount(amount) {
		    var inputAmount = document.getElementById("<%=numTAmount_C_A.ClientID %>").value;
		    if (parseFloat(amount) != parseFloat(inputAmount)) {
		        if (!confirm("输入的前期该合同项下累计拨付金额(" + inputAmount + ")与审核员输入的金额(" + amount + ")不同，您确定使用您输入的金额为准吗？")) {
		            document.getElementById("<%=numTAmount_C_A.ClientID %>").value = "";
		            document.getElementById("<%=numTAmount_C_A.ClientID %>").focus();
		        }
		    }
		}

		function ImportOpinion(txtID) {
		    var obj = new Object();
		    obj.name = "选择常用意见";
		    var UrlTmp = escape('<%=Honestysoft.Baseframework.WebUI.Globals.Home %>Module/Audit/SelectOpinion.aspx');
		    var retValue = window.showModalDialog('<%=Page.ResolveClientUrl("~/") %>Scripts/ShowDlg.aspx?url=' + UrlTmp, obj, 'scroll:0;status:0;help:1;resizable:0;dialogWidth:300px;dialogHeight:300px');
		    if (typeof (retValue) != "undefined" && retValue != null && retValue != "") {
		        document.getElementById(txtID).value += unescape(retValue);
		    }
		    document.getElementById(txtID).focus();
		    return false;
		}
		
		function checkSave() { 
            //要将千分号去除
		    var docRecAmout= document.getElementById("<%=numAmount_DocRec.ClientID %>").value.replace(/,/g,'');
            var caAmount = document.getElementById("<%=numTAmount_C_A.ClientID %>").value.replace(/,/g,'');
            var curAmount = document.getElementById("<%=numCurAmount.ClientID %>").value.replace(/,/g,'');
            var cAmount = document.getElementById("<%=numAmount_C.ClientID %>").value.replace(/,/g,'');
            if(docRecAmout==""){
                docRecAmout="0";
                document.getElementById("<%=numAmount_DocRec.ClientID %>").value="0";
            }
            if(caAmount==""){
                caAmount="0"; 
                document.getElementById("<%=numTAmount_C_A.ClientID %>").value="0";
            }
            if(curAmount==""){
                curAmount="0"; 
                document.getElementById("<%=numCurAmount.ClientID %>").value="0";
            }
            if(cAmount==""){
                cAmount="0";
                document.getElementById("<%=numAmount_C.ClientID %>").value="0";
            }
            if(isNaN(docRecAmout)){
                alert("输入的【本合同本笔申请资金金额】值无效！");
                document.getElementById("<%=numAmount_DocRec.ClientID %>").focus();
                return false;
            }
            if(isNaN(caAmount)){
                alert("输入的【前期该合同项下的累计拨款金额】值无效！");
                document.getElementById("<%=numTAmount_C_A.ClientID %>").focus();
                return false;
            }
            if(isNaN(curAmount)){
                alert("输入的【本合同本期审核资金金额】值无效！");                
                document.getElementById("<%=numCurAmount.ClientID %>").focus();
                return false;
            }
            if(isNaN(cAmount)){
                alert("输入的【合同总价金额】值无效！");
                document.getElementById("<%=numAmount_C.ClientID %>").focus();
                return false;
            }
            
            if(parseFloat(curAmount) != 0){
            if (parseFloat(docRecAmout) == 0) {
                alert("请输入【本合同本笔申请资金金额】！");
                document.getElementById("<%=numAmount_DocRec.ClientID %>").focus();
                return false;
            }
            }
            if (parseFloat(cAmount) == 0) {
                alert("请输入【合同总价金额】！");
                document.getElementById("<%=numAmount_C.ClientID %>").focus();
                return false;
            }
            locking();
            return true;
		}
		function locking() {
		    document.getElementById("divImg").innerHTML = "<img src='../../images/loading1.gif' alt='' />";
		    document.all.ly.style.display = "block";
		    document.all.ly.style.width = document.body.clientWidth;
		    document.all.ly.style.height = document.body.clientHeight;
		    document.all.Layer2.style.display = 'block';
		}
		function unlocking() {
		    document.all.ly.style.display = 'none';
		    document.all.Layer2.style.display = 'none';
		}
		function Print() {
            document.getElementById('lockMsg').innerText='正在打开Excel文件，请稍候...';
		    locking();
            getURL("../../Reports/<%=_BatchNo %>/<%=_Code %>.xlsx");
		}
        function countDown(Secs) {
		        if (Secs > 0) {
		            setTimeout("countDown(" + Secs + "-1)", 1000);
		        }
		        else {
		            getURL("../../Reports/<%=_BatchNo %>/<%=_Code %>.xlsx");
		        }
		    }
            var iGet=0;
		    function getURL(url) {
		        var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		        xmlhttp.open("GET", url, false);
		        xmlhttp.send();
		        if (xmlhttp.readyState == 4) {
		            if (xmlhttp.Status == 200) {
                        unlocking();
		                window.open(url);
		            }
		            else {
                        if(iGet == 10){
                            document.getElementById('lockMsg').innerText='无法找到Excel文件，正在重新导出到Excel，请稍候...';
                            $.ajax({
		                        type: "POST",
		                        url: 'CreateAT.ashx?ID=<%=Request["ID"]+"" %>&randID=' + escape(new Date()),
		                        success: function (msg) {
                                    if(msg !="0"){
                                        unlocking();
		                                window.open(unescape(msg));
                                    }		            
		                        },
		                        error: function () { unlocking(); alert('服务器出错,无法获取数据！'); }
		                    });
                            //unlocking();
                            //alert("无法找到Excel文件，可能数据仍在导出中，请稍后重试！");
                        }
                        else{
                            iGet++;
		                    countDown(3);
                        }
		            }
		        }
		    }
        function outputExcel(){
            $.ajax({
		        type: "POST",
		        url: 'CreateAT.ashx?ID=<%=Request["ID"]+"" %>&randID=' + escape(new Date())
		    });
        }
		function saveInvoice() {
            var dataString="";
		    if ($('#tt').datagrid('acceptChanges')) {
		        var rows = $('#tt').datagrid('getRows');
		        for (var i = 0; i < rows.length; i++) {
		            if (rows[i].InvoiceCode == "") {
		                alert('第' + (i + 1) + '行的发票代码不能为空！');
		                return false;
		            }
		            if (rows[i].InvoiceNo == "") {
		                alert('第' + (i + 1) + '行的发票号码不能为空！');
		                return false;
		            } 
                    if (rows[i].Amount == "") {
		                alert('第' + (i + 1) + '行的金额不能为空！');
		                return false;
		            }
                    if(dataString != ""){
                        dataString += ",";
                    }
                    dataString += rows[i].InvoiceNo+"|"+rows[i].InvoiceCode+"|"+rows[i].Amount.replace(/,/g,'')+"|"+rows[i].IsChecked+"|"+ escape(rows[i].Remark);
		        }
                if(dataString != ""){
                $.ajax({
                    type: 'POST',
                    url: "SaveInvoice.ashx",
                    data: {"ID":"<%=Request["ID"]+"" %>","Data":dataString,"Data2":rows},
                    success: function (msg) {
                    if(unescape(msg) !="0"){
                        alert(unescape(msg));
                        return false;
                    }
                    else{
                        alert('已检查并成功保存发票信息！');
                    }
		            }
                });
            }
            }
            
            return true;
		}
		$(function () {
		    var lastIndex;
		    $('#tt').datagrid({
                loadMsg:"正在加载发票数据，请稍候……",
		        url: 'getInvoice.ashx?ID=<%=Request["ID"] %>&randID=' + escape(new Date()),
		        toolbar: [{
		            text: '新增',
		            handler: function () {
		                $('#tt').datagrid('endEdit', lastIndex);
		                $('#tt').datagrid('appendRow', {
		                    InvoiceNo: '',
		                    InvoiceCode: '',
		                    Amount: '',
		                    IsChecked: '',
		                    Remark: ''
		                });
		                var lastIndex = $('#tt').datagrid('getRows').length - 1;
		                $('#tt').datagrid('selectRow', lastIndex);
		                $('#tt').datagrid('beginEdit', lastIndex);
		            }
		        }, '-', {
		            text: '删除',
		            handler: function () {
		                $('#tt').datagrid('endEdit', lastIndex);
		                var row = $('#tt').datagrid('getSelected');
		                if (row) {
		                        $.ajax({
                                type: 'POST',
                                url: "DeleteInvoice.ashx",
                                data: {"ID":"<%=Request["ID"]+"" %>","InvoiceNo":row.InvoiceNo,"InvoiceCode":row.InvoiceCode},
                                success: function (msg) {
                                var index = $('#tt').datagrid('getRowIndex', row);
		                        $('#tt').datagrid('deleteRow', index);
		                        }
                            });
		                }
		            }
                    }, '-', {
		            text: '检查并保存发票',
		            handler: function () {
		                saveInvoice();
		            }
		        }],
		        onBeforeLoad: function () {
		            $(this).datagrid('rejectChanges');
		        },
		        onClickRow: function (rowIndex) {
		            if (lastIndex != rowIndex) {
		                $('#tt').datagrid('endEdit', lastIndex);
		                $('#tt').datagrid('beginEdit', rowIndex);
		            }
                    var ed = $('#tt').datagrid('getEditors', rowIndex);  
                    for (var i = 0; i < ed.length; i++)  
                    {  
                        var e = ed[i];  
                        if(e.field == "Amount")  
                        {  
                            $(e.target).val($(e.target).val().replace(/,/g,''));
                        }  
                    }
		            lastIndex = rowIndex;
		        }
		    });
		});		 
        //如果是系统管理员角色将审核金额为0，则申请金额也必须清0，回执等相关也必须清0
        //同时，T=A+H必须修改，匹配关系及核算结果也需要修改
        function doBackAT(sAmount,amount){
            if (parseFloat(amount) == 0) {
                if(!confirm("当审核金额为0时，本笔申请金额将同时修改为0，是否继续？")){
                    document.getElementById('<%=numCurAmount.ClientID %>').value=sAmount;
                    document.getElementById('<%=numCurAmount.ClientID %>').focus();
                }
                else{
                    document.getElementById('<%=numAmount_DocRec.ClientID %>').value=amount;  
                }
            }
        }

        //1.本合同本笔申请资金金额A:numAmount_DocRec----------------------------(输入项)
        //2.合同总价金额S:numAmount_C-------------------------------------------(输入项)
        //3.前期该合同项下的累计拨付金额H:numTAmount_C_A------------------------(输入项)
        //4.前期该合同项下的累计拨付比例：H/S:tdTAmount_C_P
        //5.本合同本期申请和前期支付累计 T=A+H ：tdTAmount_C_T
        //6.与合同总价的匹配关系核算(A+H之和与合同总价比例):(A+H)/S:tdPP_CPrice
        //7.与合同总价的匹配关系核算(A+H之和与合同总价比例)核算结果:fAlarm
        //8.本合同本期审核金额：numCurAmount------------------------------------(输入项)
        //9.核算结果 (审核金额+H)/S：tdPP_CPrice_Amount_S_Result


        function Compute1(){
            //刷新5,6,7            
            var A=document.getElementById("<%=numAmount_DocRec.ClientID %>").value.replace(/,/g,'');
            var H=document.getElementById("<%=numTAmount_C_A.ClientID %>").value.replace(/,/g,'');
            var S=document.getElementById("<%=numAmount_C.ClientID %>").value.replace(/,/g,'');
            if(A==''){
                A='0';
            }
            if(H==''){
                H='0';
            }
            if(S==''){
                S='0';
            }
            var T=0;
            try
            {
                T=parseFloat(A)+parseFloat(H);
                document.getElementById("tdTAmount_C_T").innerHTML=commafy(T);
                if(S!='0'){
                    document.getElementById("tdPP_CPrice").innerHTML=innerHTML="("+commafy(T)+"/"+commafy(parseFloat(S))+")*100%="+(T/parseFloat(S)*100).toFixed(2).toString()+"%≤100%";
                    document.getElementById("fAlarm").innerHTML=(T/parseFloat(S)*100).toFixed(2).toString()+"%";
                }
            }
            catch(e){
            }
        }
        function Compute2(){
            //刷新4,6,7            
            var A=document.getElementById("<%=numAmount_DocRec.ClientID %>").value.replace(/,/g,'');
            var H=document.getElementById("<%=numTAmount_C_A.ClientID %>").value.replace(/,/g,'');
            var S=document.getElementById("<%=numAmount_C.ClientID %>").value.replace(/,/g,'');
            if(A==''){
                A='0';
            }
            if(H==''){
                H='0';
            }
            if(S==''){
                S='0';
            }
            var T=0;
            try
            {
                T=parseFloat(A)+parseFloat(H);
                if(S!='0'){
                    document.getElementById("tdTAmount_C_P").innerHTML=(parseFloat(H)/parseFloat(S)*100).toFixed(2).toString()+"%";
                    document.getElementById("tdPP_CPrice").innerHTML=innerHTML="("+commafy(T)+"/"+commafy(parseFloat(S))+")*100%="+(T/parseFloat(S)*100).toFixed(2).toString()+"%≤100%";
                    document.getElementById("fAlarm").innerHTML=(T/parseFloat(S)*100).toFixed(2).toString()+"%";
                }
            }
            catch(e){
            }
        }
        function Compute3(){
            //刷新4,5,6,7            
            var A=document.getElementById("<%=numAmount_DocRec.ClientID %>").value.replace(/,/g,'');
            var H=document.getElementById("<%=numTAmount_C_A.ClientID %>").value.replace(/,/g,'');
            var S=document.getElementById("<%=numAmount_C.ClientID %>").value.replace(/,/g,'');
            if(A==''){
                A='0';
            }
            if(H==''){
                H='0';
            }
            if(S==''){
                S='0';
            }
            var T=0;
            try
            {
                T=parseFloat(A)+parseFloat(H);
                document.getElementById("tdTAmount_C_T").innerHTML=commafy(T);
                if(S!='0'){
                    document.getElementById("tdTAmount_C_P").innerHTML=(parseFloat(H)/parseFloat(S)*100).toFixed(2).toString()+"%";
                    document.getElementById("tdPP_CPrice").innerHTML=innerHTML="("+commafy(T)+"/"+commafy(parseFloat(S))+")*100%="+(T/parseFloat(S)*100).toFixed(2).toString()+"%≤100%";
                    document.getElementById("fAlarm").innerHTML=(T/parseFloat(S)*100).toFixed(2).toString()+"%";
                }
            }
            catch(e){
            }
        }
        function Compute8(){
            //刷新9            
            var A=document.getElementById("<%=numCurAmount.ClientID %>").value.replace(/,/g,'');
            var H=document.getElementById("<%=numTAmount_C_A.ClientID %>").value.replace(/,/g,'');
            var S=document.getElementById("<%=numAmount_C.ClientID %>").value.replace(/,/g,'');
            if(A==''){
                A='0';
            }
            if(H==''){
                H='0';
            }
            if(S==''){
                S='0';
            }
            var T=0;
            try
            {
                T=parseFloat(A)+parseFloat(H);
                document.getElementById("tdTAmount_C_T").innerHTML=commafy(T);
                if(S!='0'){
                    document.getElementById("tdPP_CPrice_Amount_S_Result").innerHTML=(T/parseFloat(S)*100).toFixed(2).toString()+"%";
                }
            }
            catch(e){
            }
        }

//        function RefreshRecP(){
//            var amount_DocRec=document.getElementById("<%=numAmount_DocRec.ClientID %>").value.replace(/,/g,'');
//            var h=document.getElementById("<%=numTAmount_C_A.ClientID %>").value.replace(/,/g,'');
//            var a=amount_DocRec;
//            var s=document.getElementById("<%=numAmount_C.ClientID %>").value.replace(/,/g,'');
//            var t=parseFloat(a)+parseFloat(h);
//            var alarmValue=(t/parseFloat(s)*100).toFixed(2);
//            document.getElementById("tdTAmount_C_T").innerHTML=commafy(t);
//            document.getElementById("tdPP_CPrice").innerHTML="("+commafy(t)+"/"+commafy(s)+")*100%="+alarmValue+"%≤100%";
//            document.getElementById("fAlarm").innerHTML=alarmValue+"%";
//        }
//        function RefreshContractP()
//        {
//            var amount_S=document.getElementById("<%=numCurAmount.ClientID %>").value.replace(/,/g,'');
//            var h=document.getElementById("<%=numTAmount_C_A.ClientID %>").value.replace(/,/g,'');
//            var s=document.getElementById("<%=numAmount_C.ClientID %>").value.replace(/,/g,'');
//            var t=parseFloat(amount_S)+parseFloat(h);
//            var alarmValue=(t/parseFloat(s)*100).toFixed(2);
//            document.getElementById("tdPP_CPrice_Amount_S_Result").innerHTML=alarmValue+"%";
//        }  
//        function RefreshHS(){
//            var h=document.getElementById("<%=numTAmount_C_A.ClientID %>").value.replace(/,/g,'');
//            var s=document.getElementById("<%=numAmount_C.ClientID %>").value.replace(/,/g,'');
//            var alarmValue=(parseFloat(h)/parseFloat(s)*100).toFixed(2);
//            document.getElementById("tdTAmount_C_P").innerHTML=alarmValue+"%";
//        } 
    </script>
    <style type="text/css">
        div
        {
            font-size:12px;font-weight:700;
        }
        table
        {
            font-size:12px;
        }
        .backToTop {
	    PADDING-RIGHT: 0px; DISPLAY: none; PADDING-LEFT: 0px; FONT-SIZE: 12px; RIGHT: 10px; FILTER: Alpha(opacity=60); PADDING-BOTTOM: 5px; WIDTH: 18px; CURSOR: pointer; COLOR: #fff; BOTTOM: 100px; LINE-HEIGHT: 1.2; PADDING-TOP: 5px; POSITION: fixed; BACKGROUND-COLOR: #000; TEXT-ALIGN: center; _position: absolute; _bottom: "auto"; opacity: .6
        }
    </style>
    <style type="text/css">
<!--

.EditCell_TextBox {
width: 90%;
border:1px solid #0099CC;
}
.EditCell_DropDownList {
width: 90%;
}
-->
</style>
</head>
<body>
    <form id="form1" runat="server">
        <script language="javascript" type="text/javascript">
          (function () {
              var $backToTopTxt = "返回顶部", $backToTopEle = $('<div class="backToTop"></div>').appendTo($("body"))
        .text($backToTopTxt).attr("title", $backToTopTxt).click(function () {
            $("html, body").animate({ scrollTop: 0 }, 120);
        }), $backToTopFun = function () {
            var st = $(document).scrollTop(), winh = $(window).height();
            (st > 0) ? $backToTopEle.show() : $backToTopEle.hide();
            //IE6下的定位
            if (!window.XMLHttpRequest) {
                $backToTopEle.css("top", st + winh - 166);
            }
        };
              $(window).bind("scroll", $backToTopFun);
              $(function () { $backToTopFun(); });
          })();
        </script>
  
        <div id="ly" style="position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #777;z-index: 2; left: 0px; display: none;">
        </div>
        <!--浮层框架开始-->
        <div id="Layer2" align="center" style="position: absolute; z-index: 3; left: 250px; top: 250px;background-color: #fff; " >
            <table width="300" border="0" cellpadding="0" cellspacing="0" style="border: 0   solid   #e7e3e7;border-collapse: collapse">
                <tr>
                    <td height="80px" align="center">
                        <table>
                            <tr>
                                <td style="width:40px;text-align:center"><div id='divImg' style="float:left;padding:12px;width:40px"></div></td>
                                <td style="font-size:12px">
                                <span id='lockMsg'>正在导出到Excel，请稍候……</span>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
        <!--浮层框架结束-->

    <div class="infoContainer"><asp:Label runat="server" ID="lblInfo" Text=""></asp:Label></div>
    <div class="button_area">
        <asp:Button runat="server" ID="btnReceive" Text="签 收" CssClass="btn_normal" onMouseOver="this.className='btn_active'" onMouseOut="this.className='btn_normal'"/>
        <asp:Button runat="server" ID="btnViewReceive" Text="查看签收意见"  class="btn_big_normal" onmouseover="this.className='btn_big_active'" onmouseout="this.className='btn_big_normal'" />
        <uc1:WFButtons ID="WFButtons1" runat="server" />
        <asp:Button runat="server" ID="btnSave" Text="保 存" CssClass="btn_normal" onMouseOver="this.className='btn_active'" onMouseOut="this.className='btn_normal'" OnClientClick="return checkSave();" onclick="btnSave_Click" />
        <asp:Button runat="server" ID="btnPrint" Text="打 印" CssClass="btn_normal" onMouseOver="this.className='btn_active'" onMouseOut="this.className='btn_normal'"  OnClientClick="Print();return false;" />
    </div>

    <div style="text-align:center;margin-top:4px">
       融资项目深超公司内部审核作业表（<%=theTable.TableType%>表）
    </div>

    <div style="text-align:right">
        审核批次:<%=theTable.BatchNo %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编号:<%=theTable.Code%>
    </div>
    <div>
        <a href="#" onclick="expandAll();">全部展开</a>&nbsp;&nbsp;<a href="#" onclick="collapseAll();">全部收缩</a>
    </div>

    <div>
         <img id="img_1" alt="收起" onclick="change('1')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
         <span style="vertical-align:middle;cursor:hand" onclick="change('1')">一、本项目基本情况</span>
    </div>
    <table cellpadding="0" cellspacing="0" border="1" class="tEdit" id="tb_1" style="display: block;" >
		<tr>
			<td class="title1" width="140px" style="text-align:left" >项目名称</td>
			<td width="280px"><%=theTable.ProjectName%></td>
			<td  class="title1" width="140px" style="text-align:left" >项目代码</td>
			<td width="280px"><%=theTable.ProjectCode%></td>
		</tr>
		<tr>
			<td class="title1"  style="text-align:left" >项目单位</td>
			<td><%=theTable.Owner971Name%></td>
			<td class="title1"  style="text-align:left" >建设单位</td>
			<td><%= string.IsNullOrEmpty(theTable.DOwnerName) ? theTable.OwnerName : "建设单位：" + theTable.OwnerName + "<br/>委托代建单位：" + theTable.DOwnerName%></td>
		</tr>
		<tr>
			<td class="title1"  style="text-align:left" >项目下合同名称</td>
			<td colspan="3"><%=theTable.ContractName%></td>
		</tr>
		<tr>
			<td class="title1"  style="text-align:left" >施工单位</td>
			<td><%=string.IsNullOrEmpty(theTable.DBankCompanyName) ? theTable.ContractorName : "施工单位：" + theTable.ContractorName + "<br/>收款单位：" + theTable.DBankCompanyName%></td>
            <td class="title1"  style="text-align:left" >资料接收时间</td>
			<td><%=FormatRecDate(theTable.DocRecTime.Value)%></td>
		</tr>
		<tr>
			<td class="title1" style="text-align:left" >开户银行</td>
			<td><%=theTable.Bank%></td>
			<td class="title1"  style="text-align:left" >收款账号</td>
			<td><%=theTable.BankAccount%></td>
		</tr>
        <tr>
            <td class="title1"  style="text-align:left" >发票信息</td>
            <td colspan="3">            
                <table id="tt" style="width:696px;height:auto;"
			        singleSelect="true">
		        <thead>
			        <tr>
				        <th field="InvoiceNo" width="138" editor="{type:'text'}">发票号码</th>
				        <th field="InvoiceCode" width="138"  editor="{type:'text'}">发票代码</th>
				        <th field="Amount" width="138" align="right" editor="{type:'numberbox',options:{precision:2}}">金额</th>
				        <th field="IsChecked" width="138" align="center" editor="{type:'checkbox',options:{on:'√',off:''}}">已上网查询真伪</th>                        
				        <th field="Remark" width="138" editor="text">备注</th>
			        </tr>
		        </thead>
	        </table>

            </td>
        </tr>
    </table>

    <div>
        <img id="img_2" alt="收起" onclick="change('2')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
        <span style="vertical-align:middle;cursor:hand" onclick="change('2')">二、本项目有关数据及统计核查</span>
    </div> 
    <table cellpadding="0"  cellspacing="0" border="1" class="tEdit" id="tb_2" style="display: block;" >
        <tr style="display:none">
            <td width="30px"></td><td width="250px"></td><td width="140px"></td><td width="140px"></td><td width="140px"></td><td width="140px"></td>
        </tr>
        <tr>
            <td class="title1" rowspan="2" >1、
            </td>
            <td class="title1"  style="text-align:left" rowspan="2" >本合同本笔申请资金金额：A
            </td>
            <td colspan="3">
                本笔申请是本期第（<%=theTable.TableNo%>）笔
            </td>
            <td style="text-align:right">
                <asp:TextBox runat="server" ID="numAmount_DocRec" Width="96%" CssClass="input2" BackColor="Yellow"  style="ime-mode:disable;text-align:right;" onbeforepaste="numboxPaste();" onkeypress="isDecimal();"  onfocus="this.style.textAlign='left';this.value = this.value.replace(/,/g,'');this.select();" onblur="this.style.textAlign='right';this.value = commafy(value);"></asp:TextBox>
            </td>
        </tr>
        <tr style="border:0">
            <td colspan="4" style="padding:0;margin:0;border:0">
                <table width="100%" class="tEdit">
                <asp:Repeater runat="server" ID="rptCurOther">
                    <ItemTemplate>
                        <tr>
                            <td style="text-align:left">本期同时申请的第（<%# DataBinder.Eval(Container.DataItem,"TableNo")%>）笔金额</td><td style="width:138px;text-align:right"><%# string.Format("{0:N}", DataBinder.Eval(Container.DataItem, "Amount_DocRec_S"))%></td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
                </table>
            </td>
        </tr>
        <tr>
            <td rowspan="2" class="title1" >2、
            </td>
            <td rowspan="2" class="title1"  style="text-align:left" >本合同前期投控公司的累计融资金额：B
            </td>
            <td>
                (<%=theTable.SummaryAmount.count_C_A%>)笔已拨付金额累计</td>
            <td style="text-align:right"><%=string.Format("{0:N}", theTable.SummaryAmount.TAmount_C_A) == "0.00" ? "" : string.Format("{0:N}", theTable.SummaryAmount.TAmount_C_A)%>
            </td>
            <td style="text-align:center">
                <%=theTable.SummaryAmount.count_C_A==0 ? "" : (string.Format("{0:N}", theTable.SummaryAmount.TAmount_C_A) == "0.00" ? "":"截止到" + string.Format("{0:yyyy-MM-dd}", theTable.SummaryAmount.TAmount_C_A_Date))%></td>
            <td rowspan="2" style="text-align:right"><%=string.Format("{0:N}", theTable.SummaryAmount.TAmount_C_NA_A)%>
            </td>
        </tr>
        <tr>
            <td>
                (<%=theTable.SummaryAmount.count_C_NA%>)笔未拨付金额明细</td>
            <td colspan="2" style="padding:0;margin:0;border:0">
                <table width="100%" class="tEdit">
                    <asp:Repeater runat="server" ID="rptTAmount_C_NA">
                        <ItemTemplate>
                            <tr><td style="text-align:right"><%# string.Format("{0:N}", DataBinder.Eval(Container.DataItem, "ActiveAmount")) == "0.00" ? "&nbsp;" : string.Format("{0:N}", DataBinder.Eval(Container.DataItem, "ActiveAmount"))%></td>
                            <td style="width:138px;text-align:center"><%# DataBinder.Eval(Container.DataItem,"AuditTableCode")%></td></tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </table>
            </td>
        </tr>
        <tr>
            <td class="title1" >3、
            </td>
            <td class="title1"  style="text-align:left" >本合同前期加本期融资金额累计：C=A+B
            </td>
            <td colspan="3">
            </td>
            <td style="text-align:right"><%=string.Format("{0:N}", theTable.SummaryAmount.TAmount_C)%>
            </td>
        </tr>
        <tr>
            <td class="title1" >4、
            </td>
            <td class="title1"  style="text-align:left" >
            本<%=theTable.TableType !="A" ? "分" : "" %>项目本期资金申请合计：D<br />（本<%=theTable.TableType !="A" ? "分" : "" %>项目所有合同本期资金申请之和）</td>
            <td>
                本<%=theTable.TableType !="A" ? "分" : "" %>项目已报审（<%=theTable.SummaryAmount.count_PC_All%>）个合同，
                本期有（<%=theTable.SummaryAmount.count_PC%>）个合同<br />
                申请（<%=theTable.SummaryAmount.count_PT%>）笔资金</td>
            <td colspan="2" style="padding:0;margin:0;border:0">
                <table width="100%" class="tEdit">
                <asp:Repeater runat="server" ID="rptCurOtherP">
                    <ItemTemplate>
                        <tr><td style="text-align:right"><%# string.Format("{0:N}", DataBinder.Eval(Container.DataItem, "Amount_DocRec_S")) == "0.00" ? "&nbsp;" : string.Format("{0:N}", DataBinder.Eval(Container.DataItem, "Amount_DocRec_S"))%></td>
                        <td style="width:138px;text-align:center"><%# DataBinder.Eval(Container.DataItem,"AuditTableCode")%></td></tr>
                    </ItemTemplate>
                </asp:Repeater>   
                </table>         
            </td>
            <td style="text-align:right">
            <%=string.Format("{0:N}",  theTable.SummaryAmount.TAmount_PT)%></td>
        </tr>
         <tr>
            <td rowspan="2" class="title1" >5、
            </td>
            <td rowspan="2" class="title1"  style="text-align:left" >
            本<%=theTable.TableType !="A" ? "分" : "" %>项目前期投控公司的累计融资金额：E<br />
            （2011年度投控拨付的本<%=theTable.TableType !="A" ? "分" : "" %>项目所有合同前<br />
                期资金之和）</td>
            <td>
                (<%=theTable.SummaryAmount.count_P_A%>)笔已拨付金额累计</td>
            <td  style="text-align:right">
            <%=string.Format("{0:N}", theTable.SummaryAmount.TAmount_P_A) == "0.00" ? "&nbsp;" : string.Format("{0:N}", theTable.SummaryAmount.TAmount_P_A)%>
            </td>
            <td style="text-align:center">
                
                <%=theTable.SummaryAmount.count_P_A==0 ? "" : "截止到" + string.Format("{0:yyyy-MM-dd}", theTable.SummaryAmount.TAmount_P_A_Date)%></td>
            <td rowspan="2" style="text-align:right"><%=string.Format("{0:N}", theTable.SummaryAmount.TAmount_P_NA_A)%>
            </td>
        </tr>
        <tr>
            <td>
                (<%=theTable.SummaryAmount.count_P_NA%>)笔未拨付金额明细</td>
            <td colspan="2" style="padding:0;margin:0;border:0">

            <table width="100%" class="tEdit">
                <asp:Repeater runat="server" ID="rptTAmount_P_NA">
                    <ItemTemplate>
                        <tr><td style="text-align:right"><%# string.Format("{0:N}", DataBinder.Eval(Container.DataItem, "ActiveAmount")) == "0.00" ? "&nbsp;" : string.Format("{0:N}", DataBinder.Eval(Container.DataItem, "ActiveAmount"))%></td>
                        <td style="width:138px;text-align:center"><%# DataBinder.Eval(Container.DataItem,"AuditTableCode")%></td></tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>

            </td>
        </tr>
         <tr>
            <td class="title1" >6、
            </td>
            <td class="title1"  style="text-align:left" >
            本<%=theTable.TableType !="A" ? "分" : "" %>项目本期加前期融资金额累计：F=D+E</td>
            <td colspan="3">
            </td>
            <td style="text-align:right">
            <%=string.Format("{0:N}", theTable.SummaryAmount.TAmount_P)%></td>
        </tr>

        <%if (theTable.TableType != "A")
          { %>

        <tr>
            <td class="title1" >7、
            </td>
            <td class="title1"  style="text-align:left" colspan="5" >
            其他各分项目本期加前期资金累计</td>
        </tr>
        <tr>
            <td colspan="6" style="margin:0;padding:0;border:0">
                <table cellpadding="0" cellspacing="0">
                    <thead>
                       <th style="width:30px">项号</th>
                       <th style="width:250px">分项目名称</th>
                       <th style="width:140px">(<%=theTable.Count_Split_PassTime_A %>笔)已拨付金额累计</th>
                       <th style="width:140px">(<%=theTable.Count_Split_PassTime_NA %>笔)未拨付金额累计</th>
                       <th style="width:140px">(<%=theTable.Count_Split_CurOther %>笔)本期初审金额累计</th>
                       <th style="width:140px">总累计</th>
                    </thead>
                    <asp:Repeater runat="server" ID="rptOtherProject">
                        <ItemTemplate>
                            <tr>
                                <td style="text-align:center"><%# DataBinder.Eval(Container.DataItem,"ProjectSN") %></td>
                                <td style="text-align:left"><%# DataBinder.Eval(Container.DataItem,"ProjectName") %></td>
                                <td style="text-align:right"><%# string.Format("{0:N}",  DataBinder.Eval(Container.DataItem,"TAmount_A")) %></td>
                                <td style="text-align:right"><%# string.Format("{0:N}",  DataBinder.Eval(Container.DataItem, "TAmount_NA"))%></td>
                                <td style="text-align:right"><%# string.Format("{0:N}",  DataBinder.Eval(Container.DataItem,"Amount_S")) %></td>
                                <td style="text-align:right"><%# string.Format("{0:N}",  DataBinder.Eval(Container.DataItem,"TotalAmount")) %></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </table>
            </td>
        </tr>
        <tr>
            <td class="title1" >8、
            </td>
            <td class="title1"  style="text-align:left" >
            其他分项目F和本分项目F合计相加：∑F</td>
            <td colspan="3">
            </td>
            <td style="text-align:right">
            <%=string.Format("{0:N}", theTable.SummaryAmount.TAmount_SumP)%></td>
        </tr>

        <%} %>
    </table>



    <div>
        <img id="img_3" alt="收起" onclick="change('3')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
        <span style="vertical-align:middle;cursor:hand" onclick="change('3')">三、项目审核要点</span>
    </div>
    <table cellpadding="0" cellspacing="0" border="1" class="tEdit" id="tb_3" style="display: block;" >
        <tr>
            <td rowspan="2" width="30px" class="title1" >(一)</td><td width="390px" class="title1" >项目审批资料的完整性</td><td width="280px" class="title1" >审核情况</td><td width="140px" class="title1" >审核员意见</td>
        </tr>
        <tr>
             <td class="title1" style="text-align:left">（A）项目审批情况汇总表（附件2）中十项完整性审核：<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblPD1" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;1、可行性研究报告批复<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblPD2" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;2、概算批复<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblPD3" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;3、环境影响审查批复<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblPD4" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;4、项目选址意见书<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblPD5" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;5、用地审查意见<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblPD6" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;6、土地证<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblPD7" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;7、土地出让合同<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblPD8" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;8、建设用地规划许可证<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblPD9" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;9、建设工程规划许可证<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblPD10" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;10、建筑工程施工许可证<br />
            （B）资本金到位情况汇总表（附件3）完整性审核：<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblZD1" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;1、发票/收据<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblZD2" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;2、预算拨付凭证/银行进账单<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblZD3" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;3、财政资金拨款申请书/建设单位内部支付审核表<br />
             &nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButtonList runat="server" ID="rblZD4" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;4、其他资本金到位材料证明</td><td>
             <a href="#" onclick="ImportOpinion('<%=txtPD1.ClientID %>');return false;" <%=GetIsDisplay() %>>导入意见</a><br />
             <asp:TextBox ID="txtPD1" runat="server" TextMode="MultiLine" Rows="18" Width="98%"></asp:TextBox>
             </td><td><a href="#" onclick="ImportOpinion('<%=txtPD1Opinion.ClientID %>');return false;" <%=GetIsDisplay() %>>导入意见</a><br /><asp:TextBox ID="txtPD1Opinion" runat="server" TextMode="MultiLine" 
                Rows="18" Width="98%"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="title1" >(二)</td><td class="title1" style="text-align:left">项目申报资料合法性</td><td>
            <a href="#" onclick="ImportOpinion('<%=txtPD2.ClientID %>');return false;" <%=GetIsDisplay() %>>导入意见</a><br />
            <asp:TextBox ID="txtPD2" runat="server" TextMode="MultiLine" Rows="3" Width="98%"></asp:TextBox></td><td>
            <a href="#" onclick="ImportOpinion('<%=txtPD2Opinion.ClientID %>');return false;" <%=GetIsDisplay() %>>导入意见</a><br />
            <asp:TextBox ID="txtPD2Opinion" runat="server" TextMode="MultiLine" Rows="3" Width="98%"></asp:TextBox></td>
        </tr>
    </table>

    <div>
         <img id="img_4" alt="收起" onclick="change('4')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
         <span style="vertical-align:middle;cursor:hand" onclick="change('4')">四、合同项下资料的汇总完整性</span>
    </div>
    <table cellpadding="0" cellspacing="0" border="1" class="tEdit" id="tb_4" style="display: block;" >
        <tr>
            <td width="30px" class="title1"></td><td width="390px" class="title1" >六大项资料完整性审核</td><td width="280px" class="title1" >审核情况</td><td width="140px" class="title1" >审核员意见</td>
        </tr>
        <tr>
            <td class="title1" ></td><td class="title1" style="text-align:left">
            <br />
            <asp:RadioButtonList runat="server" ID="rblCD1" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;（一）深圳市政府融资项目资金支付申请表（附件4）<br />
            <asp:RadioButtonList runat="server" ID="rblCD2" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;（二）工程款支付汇总表（附件5）<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（三）资金支付资料明细表（附件6）<br />
            <asp:RadioButtonList runat="server" ID="rblCD3" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1、监理合同<br />
            <asp:RadioButtonList runat="server" ID="rblCD4" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2、票据（发票/收据）<br />
            <asp:RadioButtonList runat="server" ID="rblCD5" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3、工程款支付内部审批表<br />
            <asp:RadioButtonList runat="server" ID="rblCD6" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4、施工单位或其他相关单位工程款支付申请书<br />
            <asp:RadioButtonList runat="server" ID="rblCD7" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;（四）项目用款计划表（附件7）<br />
            <asp:RadioButtonList runat="server" ID="rblCD8" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;（五）单项工程施工合同或工程设计、咨询合同等<br />
            <asp:RadioButtonList runat="server" ID="rblCD9" RepeatColumns="2" RepeatLayout="Flow"></asp:RadioButtonList>&nbsp;&nbsp;&nbsp;&nbsp;（六）中标通知书</td><td>
                 <a href="#" onclick="ImportOpinion('<%=txtCD.ClientID %>');return false;" <%=GetIsDisplay() %>>导入意见</a><br />
                 <asp:TextBox runat="server" TextMode="MultiLine" Rows="12" Width="98%"  BackColor="Yellow"
                    ID="txtCD"></asp:TextBox>
                 </td><td>
                 <a href="#" onclick="ImportOpinion('<%=txtCDOpinion.ClientID %>');return false;" <%=GetIsDisplay() %>>导入意见</a><br />
                 <asp:TextBox ID="txtCDOpinion" runat="server" TextMode="MultiLine" 
                    Rows="12" Width="98%"></asp:TextBox></td>
        </tr>
    </table>

    <div>
        <img id="img_5" alt="收起" onclick="change('5')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
        <span style="vertical-align:middle;cursor:hand" onclick="change('5')">五、资本金到位情况</span>
    </div>
    <table cellpadding="0" cellspacing="0" border="1" class="tEdit" id="tb_5" style="display: block;" >
        <tr>
            <td width="30px"  class="title1"></td><td width="390px" align="left" class="title1"></td><td width="280px"  class="title1" >
            审核情况</td><td width="140px"  class="title1" >审核员意见</td>
        </tr>
        <tr>
            <td width="30px" class="title1" >1、</td><td width="390px" class="title1"   style="text-align:left" >
            本项目2010年及以前财政累计安排投资（以971号文件为准）</td><td width="280px" style="text-align:right"><%=string.Format("{0:N}",  theTable.Amount_CZLJ)%></td>
            <td width="140px" rowspan="3">
            <a href="#" onclick="ImportOpinion('<%=txtZDOpinion.ClientID %>');return false;" <%=GetIsDisplay() %>>导入意见</a><br />
                 <asp:TextBox ID="txtZDOpinion" runat="server" TextMode="MultiLine" 
                    Rows="5" Width="98%"></asp:TextBox></td>
        </tr>
         <tr>
            <td  class="title1" >2、</td><td class="title1"   style="text-align:left" >本项目<%=theTable.TableType != "A" ? "所有分项目" : ""%>资本金实际到位情况<%=theTable.TableType != "A" ? "合计" : ""%></td><td style="text-align:right"><%=string.Format("{0:N}", theTable.TableType != "A" ? theTable.Amount_SumZBJ : theTable.Amount_ZBJ)%></td>
        </tr>
         <tr>
            <td class="title1" >3、</td><td class="title1"   style="text-align:left" >本<%=theTable.TableType != "A" ? "分" : ""%>项目新增资本金情况（如有则填写）</td><td style="text-align:right"><%=string.Format("{0:N}",  theTable.Amount_ZBJ_Add)%></td>
        </tr>
    </table>


    <div>
        <img id="img_6" alt="收起" onclick="change('6')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
        <span style="vertical-align:middle;cursor:hand" onclick="change('6')">六、该笔申请资金与项目总投资关系核算</span>
    </div>
    <table cellpadding="0" cellspacing="0" border="1" class="tEdit" id="tb_6" style="display: block;" >
        <tr>
            <td width="30px" class="title1"></td><td width="390px" class="title1"></td><td colspan="2" width="280px" class="title1" >审核情况</td><td width="140px" class="title1" >审核员意见</td>
        </tr>
        <tr>
            <td class="title1" >1、</td><td class="title1"   style="text-align:left" >本<%=theTable.TableType != "A" ? "分" : ""%>项目总投资（以项目总概算批复金额为准）T</td>
            <td colspan="2" style="text-align:right"><%=string.Format("{0:N}",  theTable.Amount_GS)%></td>
            <td rowspan="9">
                  <a href="#" onclick="ImportOpinion('<%=txtForPPriceOpinion.ClientID %>');return false;" <%=GetIsDisplay() %>>导入意见</a><br />
                 <asp:TextBox ID="txtForPPriceOpinion" runat="server" TextMode="MultiLine" 
                    Rows="9" Width="98%"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="title1" >2、</td><td class="title1"  style="text-align:left" >本<%=theTable.TableType != "A" ? "分" : ""%>项目资本金实际到位情况 G</td>
            <td colspan="2" style="text-align:right"><%=string.Format("{0:N}",  theTable.Amount_ZBJ)%></td>
        </tr>
        <tr>
            <td rowspan="2" class="title1" >3、</td><td rowspan="2" class="title1"   style="text-align:left" >匹配关系核算（F+G 不超过<%=theTable.TableType != "A" ? "本分" : ""%>项目总概算批复金额<%=theTable.TableType != "A" ? "的合计" : ""%>）<br /><%=theTable.TableType != "A" ? "(F+G)/T*100%≤100%" : ""%></td>
            <td colspan="2" style="text-align:left"><%=theTable.SummaryAmount.PP_GS%></td>
        </tr>
        <tr>
            <td class="title1" >核算结果：</td><td  style="text-align:center"><%=string.Format("{0:P}", theTable.SummaryAmount.PP_GSResult)%></td>
        </tr>
        <tr>
            <td rowspan="3" class="title1" >4、</td><td class="title1" style="text-align:left" >本<%=theTable.TableType !="A" ? "分" : "" %>项目项下全部合同总价金额累计 U</td><td colspan="2" style="text-align:right" ><%=string.Format("{0:N}",  theTable.SummaryAmount.TAmount_U)%></td>
        </tr>
        
        <tr>
            <td rowspan="2" class="title1" style="text-align:left" >合同总价金额累计与<%=theTable.TableType !="A" ? "分" : "" %>项目总投资匹配关系核算（U不超过本<%=theTable.TableType !="A" ? "分" : "" %>项目总概算批复金额 T)</td><td colspan="2"><%=theTable.SummaryAmount.PP_TAmount_U_T%></td>
        </tr>
        <tr>
            <td class="title1" >核算结果：</td><td style="text-align:center"><font color="black" id="U_TAlarm"><%=string.Format("{0:P}", theTable.SummaryAmount.PP_TAmount_U_T_Result)%></font></td>
            <script language="javascript" type="text/javascript">
                function UTAlarm(){
                    if (document.getElementById("U_TAlarm").style.color == "black") {
                        document.getElementById("U_TAlarm").style.color = "red";
	                }
	                else{
	                    document.getElementById("U_TAlarm").style.color = "black";
	                }

	            }
	            if(<%= theTable.SummaryAmount.PP_TAmount_U_T_Result %> >= 0.9){
	                    setInterval("UTAlarm()", 500);
                    }
            </script>
        </tr>
    </table>

    <div>
         <img id="img_7" alt="收起" onclick="change('7')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
         <span style="vertical-align:middle;cursor:hand" onclick="change('7')">七、与年度投资计划的关系审核</span>
    </div>
    <table cellpadding="0" cellspacing="0" border="1" class="tEdit" id="tb_7" style="display: block;" >
        <tr>
            <td width="30px" class="title1"></td><td width="390px" class="title1"></td>
            <td width="280px" colspan="2" class="title1" >审核情况</td>
            <td  class="title1" width="140px">审核员意见</td>
        </tr>
        <tr>
            <td colspan="4" style="padding:0;margin:0;border:0" >         
             <table width="100%" class="tEdit">
                <asp:Repeater runat="server" ID="rptYearPlan">
                    <ItemTemplate>
                        <tr>
                            <td style="width:30px;" class="title1"><%# Container.ItemIndex+1 %>、</td>
                            <td class="title1" style="text-align:left">本项目<%# DataBinder.Eval(Container.DataItem, "TheYear")%>年度投资计划 P<%# Container.ItemIndex+1 %><br /><%# DataBinder.Eval(Container.DataItem, "DocNo") + "" != "" ? "（以" + DataBinder.Eval(Container.DataItem, "DocNo") + "号文件中的" + DataBinder.Eval(Container.DataItem, "TheYear") + "年融资计划为准）" : ""%></td>
                            <td style="width:280px;text-align:right;"><%# string.Format("{0:N}",  DataBinder.Eval(Container.DataItem,"Amount")) %></td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
             </table>
             </td>
             <td rowspan="4">
                 <a href="#" onclick="ImportOpinion('<%=txtForPlanOpinion.ClientID %>');return false;" <%=GetIsDisplay() %>>导入意见</a><br />
                 <asp:TextBox ID="txtForPlanOpinion" runat="server" TextMode="MultiLine" 
                    Rows="6" Width="98%"></asp:TextBox>
             </td>
        </tr>
         <tr>
            <td class="title1" ><%= yearCount+1%>、</td><td class="title1"  style="text-align:left" >累计年度投资计划 P=<%=yearString%></td>
            <td colspan="2" style="text-align:right"><%=string.Format("{0:N}",  theTable.SummaryAmount.TAmount_Plan)%></td>
        </tr>
         <tr>
            <td rowspan="2" class="title1" ><%= yearCount+2%>、</td>
            <td rowspan="2" class="title1"  style="text-align:left" >匹配关系核算（<%=theTable.TableType != "A" ? "∑" : ""%>F不超过市发改委下达的累计年度投资计划）</td>
            <td colspan="2" style="text-align:left"><%=theTable.SummaryAmount.PP_Plan %></td>
        </tr>
        <tr>
            <td class="title1" >核算结果：</td>
            <td style="text-align:center"><%=string.Format("{0:P}", theTable.SummaryAmount.PP_PlanResult)%></td>
        </tr>
    </table>


    <div>
        <img id="img_8" alt="收起" onclick="change('8')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
        <span style="vertical-align:middle;cursor:hand" onclick="change('8')">八、与批准贷款额度的关系审核</span>
    </div>
    <table cellpadding="0" cellspacing="0" border="1" class="tEdit" id="tb_8" style="display: block;" >
        <tr>
            <td width="30px" class="title1"></td><td width="390px" class="title1"></td>
            <td width="280px" class="title1" >审核情况</td><td width="140px" class="title1" >审核员意见</td>
        </tr>
        <tr>
            <td class="title1" >1、</td><td class="title1"   style="text-align:left" >本<%=theTable.TableType != "A" ? "分" : ""%>项目的国开行贷款额度<%=theTable.TableType != "A" ? "合计" : ""%> Q</td>
            <td style="text-align:right"><%=string.Format("{0:N}",  theTable.Amount_GKLoan)%></td>
            <td rowspan="6">
                 <a href="#" onclick="ImportOpinion('<%=txtForLoanOpinion.ClientID %>');return false;" <%=GetIsDisplay() %>>导入意见</a><br />
                 <asp:TextBox ID="txtForLoanOpinion" runat="server" TextMode="MultiLine" 
                    Rows="10" Width="98%"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td rowspan="2" class="title1" >2、</td><td class="title1"   style="text-align:left" >本<%=theTable.TableType != "A" ? "分" : ""%>项目贷款累计与国开行贷款额度的匹配关系核算</td>
            <td style="text-align:left"><%=theTable.SummaryAmount.PP_PGK%></td>
        </tr>
        <tr>
            <td class="title1" style="text-align:left">F/Q*100%≤100%</td>
            <td style="text-align:center"><%=string.Format("{0:P}", theTable.SummaryAmount.PP_PGKResult)%></td>
        </tr>
        <tr>
            <td class="title1" >3、</td>
            <td class="title1" style="text-align:left" >本项目<%=theTable.TableType != "A" ? "所有分项目" : ""%>的市投控公司融资额度<%=theTable.TableType != "A" ? "合计" : ""%>R<br />
            （按971文件中2011年融资计划及以后年度融资之和）</td><td style="text-align:right"><%=string.Format("{0:N}", theTable.TableType !="A" ?  theTable.Amount_SumPSTK: theTable.Amount_PSTK)%></td>
        </tr>
        <tr>
            <td rowspan="2" class="title1" >4、</td>
            <td class="title1"  style="text-align:left" ><%=theTable.TableType != "A" ? "各分" : "本"%>项目的贷款累计与投控融资额度的匹配关系核算</td>
            <td style="text-align:left"><%=theTable.SummaryAmount.PP_PLoanTK %></td>
        </tr>
        <tr>
            <td class="title1" style="text-align:left"><%=theTable.TableType != "A" ? "∑" : ""%>F/R*100%≤100%</td>
            <td style="text-align:center"><%=string.Format("{0:P}", theTable.SummaryAmount.PP_PLoanTKResult)%></td>
        </tr>
    </table>

    <div>
        <img id="img_9" alt="收起" onclick="change('9')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
        <span style="vertical-align:middle;cursor:hand" onclick="change('9')">九、与合同总价的关系审核</span>
    </div>
    <table cellpadding="0" cellspacing="0" border="1" class="tEdit" id="tb_9" style="display: block;" >
        <tr>
            <td width="30px" class="title1"></td><td width="390px" class="title1"></td>
            <td width="280px" class="title1" colspan="2" >审核情况</td>
            <td width="140px" class="title1" >审核员意见</td>
        </tr>
        <tr>
            <td class="title1">1、</td>
            <td class="title1"  style="text-align:left" >合同总价金额（附件5：工程款支付汇总表）S</td> 
            <td colspan="2" >
                <asp:TextBox runat="server" ID="numAmount_C" Width="96%" CssClass="input2" BackColor="Yellow" style="ime-mode:disable;text-align:right;" onbeforepaste="numboxPaste();" onkeypress="isDecimal();"  onfocus="this.style.textAlign='left';this.value = this.value.replace(/,/g,'');this.select();" onblur="this.style.textAlign='right';this.value = commafy(value);"></asp:TextBox>
            </td> 
            <td rowspan="8">
                <a href="#" onclick="ImportOpinion('<%=txtForCPriceOpinion.ClientID %>');return false;" <%=GetIsDisplay() %>>导入意见</a><br />
                 <asp:TextBox ID="txtForCPriceOpinion" runat="server" TextMode="MultiLine" 
                    Rows="10" Width="98%"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="title1">2、</td>
            <td class="title1"  style="text-align:left" >前期该合同项下的累计拨款金额（附件5监理意见）H</td> 
            <td colspan="2">
                <asp:TextBox runat="server" CssClass="input2" Width="96%" ID="numTAmount_C_A" BackColor="Yellow" style="ime-mode:disable;text-align:right;" onbeforepaste="numboxPaste();" onkeypress="isDecimal();"  onfocus="this.style.textAlign='left';this.value = this.value.replace(/,/g,'');this.select();" onblur="this.style.textAlign='right';this.value = commafy(value);"></asp:TextBox>
            </td> 
        </tr>
        <tr>
            <td class="title1">3、</td> <td class="title1"  style="text-align:left" >前期该合同项下的累计拨款比例</td> 
            <td class="title1" >H/S</td> 
            <td style="text-align:center" id="tdTAmount_C_P"><%=string.Format("{0:P}", theTable.SummaryAmount.TAmount_C_P)%></td> 
        </tr>
        <tr>
            <td class="title1">4、</td>
            <td class="title1"  style="text-align:left" >本合同本期申请金额和前期支付的累计：T=A+H</td>
            <td colspan="2" style="text-align:right" id="tdTAmount_C_T"><%=string.Format("{0:N}",  theTable.SummaryAmount.TAmount_C_T)%></td> 
        </tr>
        <tr>
            <td rowspan="2" class="title1">5、</td>
            <td rowspan="2" class="title1" style="text-align:left" >与合同总价的匹配关系核算（A+H之和与合同总价比例、<br />
            工程类合同不超过85%，服务类合同不超过90%）
            </td> 
            <td colspan="2" style="text-align:left" id="tdPP_CPrice"><%=theTable.SummaryAmount.PP_CPrice%></td> 
        </tr>
        <tr>
            <td class="title1" >核算结果：</td>
            <td style="text-align:center"><font color="black" id="fAlarm"><%=string.Format("{0:P}", theTable.SummaryAmount.PP_CPriceResult)%></font>        
            <script language="javascript" type="text/javascript">
                function alarm(){
                    if (document.getElementById("fAlarm").style.color == "black") {
                        document.getElementById("fAlarm").style.color = "red";
	                }
	                else{
	                    document.getElementById("fAlarm").style.color = "black";
	                }

	            }
	            if ('<%=theTable.ContractCategory %>' == '10031502') {//施工类85%
                    if(<%= theTable.SummaryAmount.PP_CPriceResult %> >= 0.85){
	                    setInterval("alarm()", 500);
                    }
	            }
	            else if ('<%=theTable.ContractCategory %>' == '10031503') {//服务类90%
                    if(<%= theTable.SummaryAmount.PP_CPriceResult %> >= 0.90){
	                    setInterval("alarm()", 500);
                    }
	            }
            </script>
            </td>
        </tr>
        <tr>
            <td rowspan="2" class="title1">6、</td>
            <td rowspan="2" class="title1"  style="text-align:left" >本合同本期审核资金金额</td> 
            <td colspan="2" style="text-align:left">
                <asp:TextBox runat="server" ID="numCurAmount" Width="96%" CssClass="input2" BackColor="Yellow" style="ime-mode:disable;text-align:right;" onbeforepaste="numboxPaste();" onkeypress="isDecimal();"  onfocus="this.style.textAlign='left';this.value = this.value.replace(/,/g,'');this.select();" onblur="this.style.textAlign='right';this.value = commafy(value);"></asp:TextBox>
            </td> 
        </tr>
        <tr>
            <td class="title1" >核算结果：</td>
            <td style="text-align:center" id="tdPP_CPrice_Amount_S_Result"><%=string.Format("{0:P}", theTable.SummaryAmount.PP_CPrice_Amount_S_Result)%></td> 
        </tr>
    </table>


    <div>
        <img id="img_10" alt="收起" onclick="change('9')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
        <span style="vertical-align:middle;cursor:hand" onclick="change('10')">十、与施工进度的关系审核</span>
    </div>
    <table cellpadding="0" cellspacing="0" border="1" class="tEdit" id="tb_10" style="display: block;" >
        <tr>
            <td width="30px" class="title1"></td>
            <td width="390px" class="title1"></td>
            <td width="280px" class="title1" colspan="2" >审核情况</td>
            <td width="140px" class="title1" >审核员意见</td>
        </tr>
        <tr>
            <td class="title1">&nbsp;</td>
            <td class="title1"  style="text-align:left" >
            申请资金与工程施工进度应同步匹配，以项目监理单位意见为准（监理
            单位盖章确认）
            </td> 
            <td colspan="2" style="text-align:left">
                 <a href="#" onclick="ImportOpinion('<%=txtForProgress.ClientID %>');return false;" <%=GetIsDisplay() %>>导入意见</a><br />
                 <asp:TextBox ID="txtForProgress" runat="server" TextMode="MultiLine" 
                    Rows="2" Width="98%"></asp:TextBox>
            </td> 
            <td>
                <a href="#" onclick="ImportOpinion('<%=txtForProgressOpinion.ClientID %>');return false;" <%=GetIsDisplay() %>>导入意见</a><br />
                 <asp:TextBox ID="txtForProgressOpinion" runat="server" TextMode="MultiLine" 
                    Rows="2" Width="98%"></asp:TextBox>
            </td>
        </tr>
    </table>

    <asp:HiddenField runat="server" ID="hidBuStatus" />
    <script language="javascript" type="text/javascript">
        unlocking();
    </script>

    </form>
</body>
</html>
